package com.tgu.home_action.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;


import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

@Data
@ApiModel(description = "老人信息")
public class OldMan implements Serializable {
    public interface update {

    }

    public interface delete {

    }

    @NotNull(message = "id不能为空", groups = {update.class, delete.class})
    private Integer id;
    @NotNull(message = "姓名不能为空")
    @ApiModelProperty("姓名")
    private String name;
    @NotNull(message = "性别不能为空")
    @ApiModelProperty("性别")
    private Short sex;
    @ApiModelProperty(value = "出生日期", dataType = "java.sql.Date")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Timestamp birthDate;
    //    @NotNull(message = "身份证号不能为空")
    @Length(min = 18, max = 18, message = "身份证号必须为18位")
    @Length(min = 18, max = 18, message = "身份证号必须为18位", groups = {update.class})
    @ApiModelProperty("身份证号")
    private String IDCard;
    @NotNull(message = "所在省份不能为空")
    @ApiModelProperty("省份")
    private String province;
    @NotNull(message = "所在城市不能为空")
    @ApiModelProperty("城市")
    private String city;
    @NotNull(message = "所在区不能为空")
    @ApiModelProperty("区")
    private String district;
    @ApiModelProperty("详细地址")
    private String address;
    //    @NotNull(message = "身高不能为空")
    @ApiModelProperty("身高")
    private Double height;
    @ApiModelProperty("体重")
    private Double weight;
    @ApiModelProperty("其他体貌特征")
    private String otherFeature;
    //    @NotNull(message = "是否老年痴呆不能为空")
    @Min(value = 1, message = "senileDementia的值只能是1或2")
    @Max(value = 2, message = "senileDementia的值只能是1或2")
    @Min(value = 1, message = "senileDementia的值只能是1或2", groups = {update.class})
    @Max(value = 2, message = "senileDementia的值只能是1或2", groups = {update.class})
    @ApiModelProperty("是否老年痴呆")
    private Short senileDementia;
    //    @NotNull(message = "残疾信息不能为空")
    @ApiModelProperty("残疾信息")
    private String disability;
    //    @ApiModelProperty("其他疾病史")
    private String otherIllness;
    @ApiModelProperty("常去地点")
    private String offerPlace;
    @ApiModelProperty("联系电话")
    private String phone;
    @NotNull(message = "证件照不能为空")
    @ApiModelProperty("证件照")
    private String identificationPhoto;
    //    @NotNull(message = "生活照不能为空")
    @ApiModelProperty("生活照")
    private String lifePhoto;
    @ApiModelProperty("其他信息")
    private String others;
    @ApiModelProperty("家属ID")
    private Integer familyId;
    @ApiModelProperty(value = "创建时间", dataType = "java.sql.Date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp createdAt;
    @ApiModelProperty(value = "修改时间", dataType = "java.sql.Date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp updatedAt;


    @JsonIgnore
    private List<Case> cases;


}
